﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace CalculatorGUI
{
    public partial class CalcTextBox : UserControl
    {
        bool selected = false;
        string text = string.Empty;

        /// <summary>
        /// constructor
        /// </summary>
        public CalcTextBox()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Gets and Sets the Selected value
        /// </summary>
        public bool Selected
        {
            get { return selected; }
            set 
            { 
                selected = value;
                if (selected)
                {
                    LayoutRoot.Background = new SolidColorBrush(Colors.White);
                }
                else
                {
                    LayoutRoot.Background = new SolidColorBrush(Colors.LightGray);
                }
            }
        }

        /// <summary>
        /// Sets the foreground color for the control
        /// </summary>
        public Brush ForeGround
        {
            get 
            {
                return textBlock1.Foreground; 
            }
            set 
            { 
                textBlock1.Foreground = value;
            }
        }

        /// <summary>
        /// Gets and Sets the Text and updates the TextBlock control
        /// </summary>
        public string Text
        {
            get { return text; }
            set 
            { 
                text = value; 
                textBlock1.Text = text; 
            }
        }
    }
}
